<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计时器vue做法</title>
    <script src="../../../.././js/vue.global.js"></script>
</head>
<body>
<!--<div id="clock"></div>-->
<div id="clock">
    {{time.toLocaleTimeString()}}
</div>

</body>
<!--<script>-->
<!--    let element=document.getElementById('clock');-->

<!--    setInterval(function (){-->
<!--        let time = new Date();-->
<!--        console.log(time);-->
<!--        element.innerText=time.toLocaleTimeString()-->
<!--    },1000)-->
<!--</script>-->
<script>
    setInterval(function (){

    })
    const app = Vue.createApp({
        data(){
            return{
                time:new Date(),
            }
        }
    })

    app.mount("#clock")
</script>
</html>